import request, { fileRequest } from '@/utils/request'

// 获取法律文档详情
export const getLegalDocumentDetail = (id) => {
  return request({
    url: `/legalDocument/detail/${id}`,
    method: 'get'
  })
}

// 分页查询法律条款
export const getLawPage = (params) => {
  return request({
    url: '/law/page',
    method: 'get',
    params
  })
}

// 获取法律条款详情
export const getLawDetail = (id) => {
  return request({
    url: `/law/${id}`,
    method: 'get'
  })
}

// 获取文件预览URL (使用文件服务)
export const getFilePreviewUrl = (objectName) => {
  return fileRequest({
    url: '/file/previewUrl',
    method: 'get',
    params: {
      objectName
    }
  })
}
